<style>
	#js_appmsg_editor .error{
		border: 1px solid #F06060;
	}
	#js_appmsg_editor .success{
		border: 1px solid #66C88D;
	}
</style>
<script type="text/javascript">
	$(function(){
		CKEDITOR.replace('TextArea1');
		if(0!=$("#article_id").val()){
			$("#fengmianId").attr("src",getRootPath()+"{:U('File/downLoad')}/id/"+$("#articleImageId").val());
			$("#fengmianId").show();
			$("#fmtpId").hide();
			
			$("#smallImgId").attr("src",getRootPath()+"{:U('File/downLoad')}/id/"+$("#articleImageId").val());
			//$("#fmPid").show();
			
			if(''!=$('#zhaiyaoTextId').val()){
				$("#addZhaiYaoId").hide();
				$("#zhaiyaoId").show();
			}
			if(''!=$('#yuanwenljTextId').val()){
				$("#addYuanWenljId").hide();
				$("#yuanwenljId").show();
			}
		}
		var type="{$article.type}";
		if(type!=""){
			$('#type_{$article.type}').show();
		}else{
			$('#type_link').show();
		}
	});
	
</script>
<div class="container-fluid" style="height: 100%;">
<ol class="breadcrumb">
		<li><a href="../manager/index.json">首页</a></li>
		<li><a href="../message/material.json">素材管理</a></li>
		<li>图文消息</li>
	</ol>
	
	<div id="pane0_1" class='row pane' style="padding: 30px 20px 0;">
		<div class="media_preview_area">
			<div class="appmsg editing">
				<div id="js_appmsg_preview" class="appmsg_content">
					<div id="appmsgItem1" class="js_appmsg_item" data-id="1" data-fileid="">
						<h4 class="appmsg_title">
							<a target="_blank" href="javascript:void(0);" onclick="return false;" id="biaotiVlaue">{$article.headTitle }</a>
						</h4>
						<div class="appmsg_thumb_wrp">
							<img class="js_appmsg_thumb appmsg_thumb" src="" id="fengmianId">
							<i class="appmsg_thumb default" id="fmtpId">封面图片</i>
						</div>
						<p class="appmsg_desc">{$article.summary }</p>
					</div>
				</div>
			</div>
		</div>
		<form id="tuwenMessageFrom">
		<input type="hidden" name="id" value="{$article.id }" id="article_id">
		<input type="hidden" name="graphic_Id" value="{$article.graphic_id}"/>
		<input type="hidden" id="article_type" name="type" value="{$article.type}"/>

		<div id="js_appmsg_editor" class="media_edit_area">
			<div class="appmsg_editor" style="margin-top: 0px;">
				<div class="inner">
					<div class="appmsg_edit_item">
						<label class="frm_label" for="">标题</label>
						<div class="frm_input_box">
							<input class="frm_input js_title" type="text" name="head_title" data-required value="{$article.head_title }" style="border: none;" onkeyup="editBiaoTi(this)">
						</div>
					</div>
					<div class="appmsg_edit_item">
						<label class="frm_label" for="">
							<strong class="title">作者</strong>
							<p class="tips l" style="margin-bottom: 0px;">（选填）</p>
						</label>
						<div class="frm_input_box">
							<input class="frm_input js_author" name="author" data-required value="{$article.author }" type="text" style="border: none;">
						</div>
					</div>
					<div class="appmsg_edit_item">
						<label class="frm_label" for="">
							<strong class="title">封面</strong>
						</label>
						<p class="js_cover_tip tips r" >大图片建议尺寸：360像素 * 200像素</p>
						<div class="frm_input_box" style="position: relative;">
							<div class="upload_box">
								<div class="upload_area" >
									<a id="js_appmsg_upload_cover" class="upload_access"  href="javascript:void(0);" width="50" height="22">
										<i class="icon18_common upload_gray"></i>
										上传
									</a>
									<ul class="upload_file_box" style="display: none;"></ul>
								</div>
							</div>
							<input type="file" id='uploadify' 
									class='btn blue-bg'
									style="width: 90px; opacity: 0; position: absolute; top: 0px;height: 30px;z-index: 999"
									name="attach" onchange="ajaxFileUpload('{:U('File/upload')}','{:U('File/downLoad')}')">
							<p class="js_cover upload_preview" style="display: none;" id="fmPid">
								<img id="smallImgId" style="width: 100px;height: 70px;">
								<a class="js_removeCover none" onclick="deletefmP()" href="javascript:void(0);">删除</a>
							</p>
							<input type="hidden" name="img_id" data-required id="articleImageId" value="{$article.img_id }">
						</div>
					</div>
					<p>
						<a class="js_addDesc" onclick="showZhaiYao(this)" href="javascript:void(0);" id="addZhaiYaoId">添加摘要</a>
					</p>
					<div class="js_desc_area dn appmsg_edit_item" style="display: none;" id="zhaiyaoId">
						<label class="frm_label" for="">摘要</label>
						<div class="frm_textarea_box">
						<textarea class="js_desc frm_textarea" onkeyup="editZhaiYao(this)" name="summary" id="zhaiyaoTextId">{$article.summary }</textarea>
						</div>
					</div>
					<div class="js_url_area dn appmsg_edit_item"   >
						<div class="frm_label" for="">消息类型</div>
						 <if condition="($article.type eq 'article')">
						  <input type="radio" name="none" value="article" checked onchange="showEditor(this.value)">文章消息
						  <input type="radio" name="none" value="link" onchange="showEditor(this.value)">网络链接
						 <else/>
						   <input type="radio" name="none" value="article" onchange="showEditor(this.value)">文章消息
						   <input type="radio" name="none" value="link" checked onchange="showEditor(this.value)">网络链接
						 </if>
					</div>
					<div id='type_article' class='article_type'>
						<div class="appmsg_edit_item">
							<label class="frm_label" for="">
								<strong class="title">正文</strong>
							</label>
							<textarea id="TextArea1" cols="20" rows="2" class="ckeditor" name="mainText">{$article.main_text }</textarea>
						</div>
						<p>
							<a class="js_addURL" onclick="showYuanWenlj(this)" href="javascript:void(0);" id="addYuanWenljId">添加原文链接</a>
						</p>
						<div class="js_url_area dn appmsg_edit_item" style="display: none;" id="yuanwenljId">
							<label class="frm_label" for="">原文链接</label>
							<div class="frm_input_box">
							<input class="js_url frm_input" name="original_link" value="{$article.original_link }" id="yuanwenljTextId" type="text" style="border: none;">
							</div>
						</div>
					</div>
					<div id='type_link' class='article_type'>
						<div class="js_url_area dn appmsg_edit_item"   id="yuanwenljId">
							<label class="frm_label" for="">链接地址</label>
							<div class="frm_input_box">
							<input class="js_url frm_input" name="link_url" value="{$article.link_url }" id="yuanwenljTextId" type="text" style="border: none;">
							</div>
						</div>
					</div>
					<i class="arrow arrow_out" style="margin-top: 0px;"></i>
					<i class="arrow arrow_in" style="margin-top: 0px;"></i>
					<div class="mask" style="display: none;"></div>
				</div>
			</div>
		</div>
		</form>
		
		<div class="tool_area">
				<div class="tool_bar">
					<span id="js_preview" class="btns btn_input btn_primary">
						<input type="button" value="预览" class="buttons">
					</span>
					<span id="js_submit" class="btns btn_input btn_primary">
						<input type="button" value="保存" class="buttons" onclick="saveArticle('{:U('Message/saveArticle')}')">
					</span>
				</div>
		</div>
	</div>
</div>
